<template>
  <div>
    <el-container style="height: 100vh">
      <el-menu router unique-opened collapse :default-active="$route.path">
        <el-submenu index="1">
          <template slot="title"><i class="el-icon-user"></i></template>
          <el-menu-item index="/students/create">新增学生证</el-menu-item>
          <el-menu-item index="/students/list">学生证列表</el-menu-item>
        </el-submenu>
      </el-menu>
      <el-container>
        <el-main>
          <router-view :key="$route.path"></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
import { Action } from "vuex-class";

@Component({})
export default class Home extends Vue {
  @Action("initStu") initStu:any;

  async created() {
    this.initStu();
  }
}
</script>

<style></style>
